package net.telesing.tcmc.back.dao;

import net.telesing.tcmc.back.model.OrganizationModel;
import net.telesing.tcmc.common.BaseDao;
import net.telesing.tcmc.common.BaseModel;
import net.telesing.tcmc.common.QueryParam;
import net.telesing.tcmc.common.QueryReturn;
import org.nutz.dao.Cnd;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.IocBean;

/**
 * Created by bys on 2015/11/3.
 */
@IocBean
public class OrganizationDao extends BaseDao
{
    private static final Class CLASS = OrganizationModel.class;

    /**
     * 删除根据id
     * @param id
     * @return
     */
    public int delete (long id){
        return super.delete(CLASS,id);
    }

    /**
     * 根据id查询
     * @param id
     * @return
     */
    public OrganizationModel fetch(long id){
        return (OrganizationModel)super.fetch(CLASS,id);
    }

    /**
     * 根据条件查询
     * @param cnd
     * @return
     */
    public OrganizationModel fetch(Cnd cnd){
        return (OrganizationModel)super.fetch(CLASS,cnd);
    }

    /**
     * 分页查询
     * @param e
     * @param <T>
     * @param <E>
     * @return
     */
    public <T extends BaseModel, E extends QueryParam> QueryReturn queryPage(E e) {
        return super.queryPage(CLASS, e);
    }

    /**
     * 执行sql语句
     * @param sql
     */
    public void touchSql(Sql sql){
        super.execute(sql);
    }
}
